#!/usr/bin/env perl

use Modern::Perl;
use Test::More tests => 9;

require AEF::AEFDump;

my $dump = AEF::AEFDump->new();

{
	my @chars = unpack('C*', "hello\tsucka");
	my $string = $dump->hexDump(\@chars);
	is($string, "68 65 6C 6C 6F 09 73 75 63 6B 61                 hello.sucka", "Check hex dump result");
	@chars = unpack('C*', "hello\tsucka and another line");
	$string = $dump->hexDump(\@chars);
	is($string, "68 65 6C 6C 6F 09 73 75 63 6B 61 20 61 6E 64 20  hello.sucka and \n61 6E 6F 74 68 65 72 20 6C 69 6E 65              another line", "Check hex dump result");
}

ok($dump->RequireDataForType(1), "Check we require data");
ok($dump->RequireDataForType(0x10f), "Check we require data");
ok($dump->RequireDataForType(33), "Check we require data");

is($dump->TypeMap(2), 'Z*', 'Check type map');
is($dump->TypeMap(0x0a), 'C', 'Check type map');
is($dump->TypeMap(0x10f), 'CCCCCCCCC', 'Check type map');
is($dump->TypeMap(3), 'C*', 'Check type map');

# FIXME: need to figure out how to test what comes through 
# via logging.

